package book;

/**
 * @User: vitobo
 * @Date: 2024-05-27
 * @Description: 书架
 */


public class BookList {

    public Book[] books = new Book[10];
    public int usedSize; // 存储当前书的数量

    public BookList(){
        books[0] = new Book("三国演义", "罗贯中", 89, "小说");
        books[1] = new Book("西游记", "吴承恩", 78, "小说");
        books[2] = new Book("红楼梦", "曹雪芹", 59, "小说");

        this.usedSize = 3;
    }

    public int getUsedSize(){
        return usedSize;
    }

    public void setUsedSize(int usedSize){
        this.usedSize = usedSize;
    }

    public Book getPos(int pos){
        return books[pos];
    }

    // 存储一本书, 到指定的位置
    public void setBooks(Book book, int pos){
        books[pos] = book;
    }

}
